home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!xmission!news
- From: tknarr@xmission.com ( Todd Knarr )
- Newsgroups: comp.lang.c++,comp.lang.c,comp.lang
- Subject: Re: Undefined behavior? on type conversion, was: Re: Hungarian notation
- Date: 8 Feb 1996 03:53:27 GMT
- Organization: Chaos Central
- Message-ID: <4fbs3n$31f@news.xmission.com>
- References: <30C40F77.53B5@swsbbs.com> <4d2ok0$69s@beach.and.nl> <4er2qo$h2s@galaxy.ucr.edu> <31118641.6802368@nntp.ix.netcom.com> <4eurpq$b75@news.xmission.com> <31137427.133220928@nntp.ix.netcom.com> <4f975g$g18@news.xmission.com> <31189e62.47294315@nntp.ix.netcom.com>
- Reply-To: tknarr@xmission.com ( Todd Knarr )
- NNTP-Posting-Host: slc81.xmission.com
- X-Newsreader: IBM NewsReader/2 v1.2
-
- In <31189e62.47294315@nntp.ix.netcom.com>, miker3@ix.netcom.com (Mike Rubenstein) writes:
- >Just as it requires a conversion to be done for (char) 256, even if
- >char is 8 bits. Again, the standard says a cast does a conversion and
- >this is the correct syntax and valid data for the operation. Hence a
- >conversion must be done.
-
- Except that you don't have legal data. 256 is not a legal value for a
- char on machines with an 8-bit char. The question is whether the standard
- defines "result" to mean only ( essentialy ) return value or whether it
- includes outcomes in general.
-
- The reference section of K&R2 isn't the standard, but it tends to use
- the same language as the standard and it refers to the result of / when
- the second operand is 0 being undefined, and I know many conforming
- compilers cause the program to terminate when you divide by 0, so if
- you're right then K&R2 and the standard use different definitions and
- I haven't seen that to be the case before.
-
- --
- Todd Knarr : tknarr@xmission.com | finger for PGP public key
- | Member, USENET Cabal
-
- Seriously, I don't want to die just yet. I don't care how
- good-looking they are, I! don't! want! to! die!"
- -- Megazone ( UF1 )
-
-